/**
 *
 * © Bahadir Zeren 2011
 * bzeren@gmail.com
 * No warranties, express or implied, are made for this program.
 *
 */

package org.baatar.net.test;

import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.baatar.net.tcp.TCPService;

/**
 * Math TCP Service main class.
 * 
 * @author Ba
 */
public class MathTCPServer {

    public static void main(String args[]) throws Exception {

        Logger logger = Logger.getLogger("MathTCPServerConsole");
        logger.addAppender((new ConsoleAppender(new PatternLayout())));

        int portNr = 4321;

        TCPService tcpService = new TCPService(new MathProcessor());
        tcpService.setListenerPort(portNr);
        tcpService.setLogger(logger);
        if (tcpService.initialize()) {
            tcpService.start();
        }

    }
}
